<template>
  <div style="width: 100%; height: auto; background: #f7f8fa;paddingTop: 1px">
    <div class="steps">
      <el-steps
        direction="horizontal"
        :active="active"
        :align-center="true"
        style="height: auto width: 100%"
      >
        <el-step title="绑定微信公众号"></el-step>
        <el-step title="预览微信公众号"></el-step>
        <el-step title="设置微信支付"></el-step>
      </el-steps>
    </div>
    <PublicSetting
      ref="mychild"
      v-if="active == 1 && authorizationStatus == 0"
      @Next="Next"
    >
    <div v-if="authorizationType" id="qrcode" ref="qrcode" style="position: absolute; top: -9999px; left: -9999px"></div>
    </PublicSetting>
    <div class="bg" v-if="active == 1 && authorizationStatus != 0">
      <div class="AppletsBind">
        <div class="AppletsBindP">
          绑定微信公众号，集沉淀、运营、唤醒粉丝功能于一体，提高转化率
        </div>
        <div>
          <div class="AppletsBindDiv">
            <div class="AppletsBindDivLeft">
              <div class="AppletsBindDivLeftImg"></div>
              <el-button
                class="AppletsBindButton"
                type="primary"
                @click="authorization"
                >已有公众号，立即绑定</el-button
              >
              <div
                class="AppletsBindTitle"
                style="color: #9797a1; font-size: 12px"
              >
                <div style="width: 200px; text-align: center">
                  为保证所有功能的正常使用，授权时<br />请把所有权限统一授权给文嘟嘟
                </div>
              </div>
            </div>
          </div>
          <div class="AppletsBindDiv">
            <div class="AppletsBindDivRight">
              <div class="AppletsBindDivRightImg"></div>
              <el-button class="AppletsBindButton" @click="register"
                >没有公众号，立即申请</el-button
              >
              <div
                class="AppletsBindTitle"
                style="color: #9797a1; font-size: 12px"
              >
                <div style="width: 200px; text-align: center">
                  请在微信公众平台申请公众号，<br />成功后再绑定文嘟嘟
                </div>
              </div>
            </div>
          </div>
        </div>

        <el-button class="AppletsBindbtn" @click="Next" :disabled="nextStep"
          ><span class="AppletsBindbtnIcon"></span
          ><span>下一步</span></el-button
        >
      </div>
    </div>
    <div class="bg" v-if="active == 2">
      <div class="AppletsBind" v-loading="loading" element-loading-background="rgba(255, 255, 255, 1)">
        <div class="AppletsBindP">预览微信公众号</div>
        <div v-if="authorizationType" class="AppletsBindDiv3" style="padding: 40px 0 0 175px;">
          <div>
            <div id="qrcode" ref="qrcode"></div>
          </div>
          <el-button
            style="position: relative; left: -20px;top:35px; width: 186px; height: 40px"
            class="AppletsBindButton2"
            type="primary"
            @click="copyText"
            >复制二维码链接</el-button
          >
        </div>
        <div style="display: flex; margin-top: 35px">
          <el-button class="AppletsBindbtn1" @click="Next3"
            ><span class="AppletsBindbtnIcon"></span
            ><span>上一步</span></el-button
          >
          <el-button class="AppletsBindbtn2" @click="Next4"
            ><span class="AppletsBindbtnIcon"></span
            ><span>下一步</span></el-button
          >
        </div>
      </div>
    </div>
    <div class="bg" v-if="active == 3">
      <div class="AppletsBind">
        <div class="AppletsBindP">设置微信支付</div>

        <!-- 审核中 -->
        <div v-if="auditState == 'APPLYMENT_STATE_AUDITING'">
          <div class="AppletsBindDiv">
            <div class="AppletsBindDivLeft">
              <div class="AppletsBindDivtopImg">
                <img :src="sign_url"/>
              </div>
              <div class="AppletsBindBox">
                <el-popover placement="top-start" width="100%" trigger="click">
                  <div style="
                    color: #9797a1;
                    height: 100%;
                    font-size: 12px;
                  ">
                    <div style="text-align: left;line-height:26px;" v-if="audit_detail">
                      <div v-for="(item, index) in audit_detail" :key="index" style="word-wrap: break-word">
                        {{ index + 1 }}.{{ item.reject_reason }}
                      </div>
                    </div>
                    <div style="text-align: left;line-height:26px;" v-if="applyment_state_msg">
                      {{ applyment_state_msg }}
                    </div>
                  </div>
                  <el-button slot="reference"
                             style="width:186px;color:color:#9797A1;position: relative;left: -57px;top: -20px;">查看审核结果
                  </el-button>
                </el-popover>
                <!--                <el-button style="-->
                <!--                    position: relative;-->
                <!--                    bottom: 5px;-->
                <!--                    left: -57px;-->
                <!--                    width: 186px;-->
                <!--                    height: 40px;-->
                <!--                  " class="AppletsBindButton2" type="primary" @click="registerPlay">设置支付方式-->
                <!--                </el-button>-->
              </div>
            </div>
          </div>
          <div class="AppletsBindDiv">
            <div class="AppletsBindDivRight">
              <div class="GainCommercial"></div>
              <div style="
                  font-size: 12px;
                  color: #9797a1;
                  position: relative;
                  top: 15px;
                  width: 195px;
                  text-align: center;
                  left: -65px;
                ">
                请联系商户代表获取商户ID
              </div>
              <el-input class="AppletsBindButton" v-model="MerchantID"
                        style="width: 195px; margin-bottom: 15px; top: 25px"></el-input>
              <el-button class="AppletsBindButton" @click="setPaymentTypeclick" style="top: 25px">保存</el-button>
            </div>
          </div>
        </div>

        <!-- 申请单已被撤销 -->
        <div v-if="auditState == 'APPLYMENT_STATE_CANCELED'" >
          <div class="AppletsBindDiv">
            <div class="AppletsBindDivLeft">
              <div class="AppletsBindDivtopImg">
                <img :src="sign_url"/>
              </div>
              <div class="AppletsBindBox">
                <el-popover placement="top-start" width="100%" trigger="click">
                  <div style="
                    color: #9797a1;
                    height: 100%;
                    font-size: 12px;
                  ">
                    <div style="text-align: left;line-height:26px;" v-if="audit_detail">
                      <div v-for="(item, index) in audit_detail" :key="index" style="word-wrap: break-word">
                        {{ index + 1 }}.{{ item.reject_reason }}
                      </div>
                    </div>
                    <div style="text-align: left;line-height:26px;" v-if="applyment_state_msg">
                      {{ applyment_state_msg }}
                    </div>
                  </div>
                  <el-button slot="reference"
                             style="width:186px;color:color:#9797A1;position: relative;left: -57px;top: -20px;">查看审核结果
                  </el-button>
                </el-popover>
                <el-button style="
                    position: relative;
                    bottom: 5px;
                    left: -57px;
                    width: 186px;
                    height: 40px;
                  " class="AppletsBindButton2" type="primary" @click="registerPlay">修改申请单
                </el-button>
              </div>
            </div>
          </div>
          <div class="AppletsBindDiv">
            <div class="AppletsBindDivRight">
              <div class="GainCommercial"></div>
              <div style="
                  font-size: 12px;
                  color: #9797a1;
                  position: relative;
                  top: 15px;
                  width: 195px;
                  text-align: center;
                  left: -65px;
                ">
                请联系商户代表获取商户ID
              </div>
              <el-input class="AppletsBindButton" v-model="MerchantID"
                        style="width: 195px; margin-bottom: 15px; top: 25px"></el-input>
              <el-button class="AppletsBindButton" @click="setPaymentTypeclick" style="top: 25px">保存</el-button>
            </div>
          </div>
        </div>

        <!--  已驳回-->
        <div v-if="auditState == 'APPLYMENT_STATE_REJECTED'">
          <div class="AppletsBindDiv">
            <div class="AppletsBindDivLeft">
              <div class="AppletsBindDivtopImg">
                <img :src="sign_url"/>
              </div>
              <div class="AppletsBindBox">
                <el-popover placement="top-start" width="100%" trigger="click">
                  <div style="
                    color: #9797a1;
                    height: 100%;
                    font-size: 12px;
                  ">
                    <div style="text-align: left;line-height:26px;" v-if="audit_detail">
                      <div v-for="(item, index) in audit_detail" :key="index" style="word-wrap: break-word">
                        {{ index + 1 }}.{{ item.reject_reason }}
                      </div>
                    </div>
                    <div style="text-align: left;line-height:26px;" v-if="applyment_state_msg">
                      {{ applyment_state_msg }}
                    </div>
                  </div>
                  <el-button slot="reference"
                             style="width:186px;color:color:#9797A1;position: relative;left: -57px;top: -20px;">查看审核结果
                  </el-button>
                  <el-button style="
                    position: relative;
                    bottom: 5px;
                    left: -57px;
                    width: 186px;
                    height: 40px;
                  " class="AppletsBindButton2" type="primary" @click="registerPlay">修改申请单
                  </el-button>

                </el-popover>
                <el-button style="
                    position: relative;
                    bottom: 5px;
                    left: -57px;
                    width: 186px;
                    height: 40px;
                  " class="AppletsBindButton2" type="primary" @click="registerPlay">修改申请单
                </el-button>
              </div>
            </div>
          </div>
          <div class="AppletsBindDiv">
            <div class="AppletsBindDivRight">
              <div class="GainCommercial"></div>
              <div style="
                  font-size: 12px;
                  color: #9797a1;
                  position: relative;
                  top: 15px;
                  width: 195px;
                  text-align: center;
                  left: -65px;
                ">
                请联系商户代表获取商户ID
              </div>
              <el-input class="AppletsBindButton" v-model="MerchantID"
                        style="width: 195px; margin-bottom: 15px; top: 25px"></el-input>
              <el-button class="AppletsBindButton" @click="setPaymentTypeclick" style="top: 25px">保存</el-button>
            </div>
          </div>
        </div>

        <!--   已创建申请单     -->
        <div v-if="auditState == 1"  style="display: flex; justify-content: center">
          <div class="AppletsBindDiv" v-if="false">
            <div class="AppletsBindDivLeft">
              <div class="AppletsBindDivtopImg">
                <!--                <img :src="sign_url"/>-->
              </div>
              <div class="AppletsBindBox">
                <el-popover placement="top-start" width="100%" trigger="click">
                  <div style="
                    color: #9797a1;
                    height: 100%;
                    font-size: 12px;
                  ">
                    <div style="text-align: left;line-height:26px;" v-if="audit_detail">
                      <div v-for="(item, index) in audit_detail" :key="index" style="word-wrap: break-word">
                        {{ index + 1 }}.{{ item.reject_reason }}
                      </div>
                    </div>
                    <div style="text-align: left;line-height:26px;" v-if="applyment_state_msg">
                      {{ applyment_state_msg }}
                    </div>
                  </div>
                  <!--                  <el-button slot="reference"-->
                  <!--                             style="width:186px;color:color:#9797A1;position: relative;left: -57px;top: -20px;">查看审核结果-->
                  <!--                  </el-button>-->
                </el-popover>

                <el-button slot="reference" style="width:186px;color:color:#9797A1;position: relative;left: -57px;top: -20px;" @click="getWechatPayAuditList">
                  选择已有支付方式</el-button>

                <el-button style="
                    position: relative;
                    bottom: 5px;
                    left: -57px;
                    width: 186px;
                    height: 40px;
                  " class="AppletsBindButton2" type="primary" @click="registerPlay">继续填写
                </el-button>


              </div>
            </div>
          </div>
          <div class="AppletsBindDiv">
            <div class="AppletsBindDivRight">
              <div class="GainCommercial"></div>
              <div style="
                  font-size: 12px;
                  color: #9797a1;
                  position: relative;
                  top: 15px;
                  width: 195px;
                  text-align: center;
                  left: -65px;
                ">
                请联系商户代表获取商户ID
              </div>
              <el-input class="AppletsBindButton" v-model="MerchantID"
                        style="width: 195px; margin-bottom: 15px; top: 25px"></el-input>
              <el-button class="AppletsBindButton" @click="setPaymentTypeclick" style="top: 25px">保存</el-button>
            </div>
          </div>
        </div>


        <!-- 未添加申请 -->
        <div v-if="auditState == 0" style="display: flex; justify-content: center">
          <div class="AppletsBindDiv" v-if="false">
            <div class="AppletsBindDivLeft">
              <div class="AppletsBindDivtopImg">
                <!--                <img :src="sign_url"/>-->
              </div>
              <div class="AppletsBindBox">
                <el-button slot="reference" style="width:186px;color:color:#9797A1;position: relative;left: -57px;top: -20px;" @click="getWechatPayAuditList">
                  选择已有支付方式</el-button>
                <el-button style="  position: relative; bottom: 5px; left: -57px;width: 186px;height: 40px;  " class="AppletsBindButton2" type="primary"  @click="registerPlay">
                  立即填写申请资料</el-button>
              </div>
            </div>
          </div>
          <div class="AppletsBindDiv">
            <div class="AppletsBindDivRight">
              <div class="GainCommercial"></div>
              <div style="
                  font-size: 12px;
                  color: #9797a1;
                  position: relative;
                  top: 15px;
                  width: 195px;
                  text-align: center;
                  left: -65px;
                ">
                请联系商户代表获取商户ID
              </div>
              <el-input class="AppletsBindButton" v-model="MerchantID"
                        style="width: 195px; margin-bottom: 15px; top: 25px"></el-input>
              <el-button class="AppletsBindButton" @click="setPaymentTypeclick" style="top: 25px">保存</el-button>
            </div>
          </div>
        </div>

        <!--待签约 -->
        <div v-if="auditState == 'APPLYMENT_STATE_TO_BE_SIGNED'">
          <div class="AppletsBindDiv">
            <div class="AppletsBindDivLeft">
              <div class="AppletsBindDivtopImg">
                <img :src="sign_url"/>
              </div>
              <div class="AppletsBindBox">
                <el-popover placement="top-start" width="100%" trigger="click">
                  <div style="
                    color: #9797a1;
                    height: 100%;
                    font-size: 12px;
                  ">
                    <div style="text-align: left;line-height:26px;" v-if="audit_detail">
                      <div v-for="(item, index) in audit_detail" :key="index" style="word-wrap: break-word">
                        {{ index + 1 }}.{{ item.reject_reason }}
                      </div>
                    </div>
                    <div style="text-align: left;line-height:26px;" v-if="applyment_state_msg">
                      {{ applyment_state_msg }}
                    </div>
                  </div>
                  <el-button slot="reference"
                             style="width:186px;color:color:#9797A1;position: relative;left: -57px;top: -20px;">请扫码完成签约
                  </el-button>
                </el-popover>
              </div>
            </div>
          </div>
          <div class="AppletsBindDiv">
            <div class="AppletsBindDivRight">
              <div class="GainCommercial"></div>
              <div style="
                  font-size: 12px;
                  color: #9797a1;
                  position: relative;
                  top: 15px;
                  width: 195px;
                  text-align: center;
                  left: -65px;
                ">
                请联系商户代表获取商户ID
              </div>
              <el-input class="AppletsBindButton" v-model="MerchantID"
                        style="width: 195px; margin-bottom: 15px; top: 25px"></el-input>
              <el-button class="AppletsBindButton" @click="setPaymentTypeclick" style="top: 25px">保存</el-button>
            </div>
          </div>
        </div>

        <div style="display: flex">
          <el-button class="AppletsBindbtn1" @click="Next1"
            ><span class="AppletsBindbtnIcon"></span
            ><span>上一步</span></el-button
          >
          <el-button class="AppletsBindbtn2" type="primary" @click="complete"
            ><span class="AppletsBindbtnIcon"></span
            ><span>完成</span></el-button
          >
        </div>
      </div>
    </div>

    <el-dialog title="选择已有支付方式" :visible.sync="dialogVisible" width="50%" height="50%">
              <div style="margin-left: 85%">
                <el-button type="success" @click="newRegisterPlay" plain>新增支付授权</el-button>
              </div>

      <div style="margin-top: 10px">
        <el-table :data="payData">
          <el-table-column property="businessCode" label="申请单号" width="200"></el-table-column>
          <el-table-column property="merchantName" label="商户姓名" width="200"></el-table-column>
          <el-table-column property="auditState" label="授权状态"></el-table-column>
          <el-table-column property="subMchid" label="商户号"></el-table-column>
          <el-table-column property="sceneStr" label="适用范围"></el-table-column>
          <el-table-column property="createTime" label="申请时间"></el-table-column>
          <el-table-column
            fixed="right"
            label="操作"
            width="100"
          >
            <template slot-scope="scope">
              <el-button v-if="scope.row.select == 1 && scope.row.subMchid != MerchantID" size="mini" type="text"
                         @click="switchPay(scope.row)" icon="el-icon-edit" v-hasPermi="['supplier:info:edit']">选择
              </el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>

    </el-dialog>
  </div>
</template>
<script>
import QRCode from "qrcodejs2";
import {
  appletGrant,
  getAuthorizerInfo,
  submitAuditRequest,
  releaseRequest,
  isBindThirdParty,
  setPaymentTypeRequest,
} from "@/api/applet/authorization";
import PublicSetting from "../PublicSetting/index.vue";
import { getCommercialData ,wechatPayAuditList,
  switchPayAudit} from "@/api/applet/payAudit";
export default {
  components: { PublicSetting },
  data() {
    return {
      //弹框
      dialogVisible: false,
      //已完成授权支付方式
      payData: [],
      //小程序AppID
      authorizerAppid: '',
      //绑定授权单
      businessCode: '',
      payAudit:true,
      loading: true,
      MerchantIDType: null,
      qrcodeUrl: "",
      iframeStr: null,
      nextStep: true,
      nextStep1: true,
      active: 1,
      MerchantID: null,
      auditstatus: null,
      authorizationType: "allwork",
      authorizationStatus: null,
      auditState: "",
      applet: "",
      mpInfo: "",
      sign_url: "",
      applyment_state_msg: "",
      reject_reason: "",
      audit_detail: "",
      authorizationUrl: "",
      QuerySwitchPayAuditVo:{
        authorizerAppid:'',
        //授权单号
        businessCode:'',
        //商户号
        subMchid:'',
        //授权方类型(小程序：applet，公众号：allwork)',
        authorizerType:''
      }
    };
  },
  created() {
    this.getisBindThirdParty();
    // var url = window.location.href;
    // var index = url.indexOf("?");
    // var indexUrl = "";
    // if (index != -1){
    //     indexUrl = url.substring(0, index);
    // }else{
    //     indexUrl = location.href;
    // }
    var msg=location.search.split("?")[1];
    if(msg!=null && msg != ''){
      let status =  msg.indexOf("=");
      console.log(status);
      let statusMsg=location.search.split("=")[1];
      let decode = decodeURI(statusMsg);
      if("success" == status){
        this.authorizationSuccess(decode);
      }else{
        this.authorizationError(decode);
      }
    }
  },

  methods: {
     authorizationSuccess(){
       this.$message({
        message: '授权成功',
        type: 'success'
      });
    },
    authorizationError(decode){
      this.$message({
      message: decode,
      type: 'warning'
    });
    },
    copyText() {
      var input = document.createElement("input");
      input.value = this.authorizationUrl;
      document.body.appendChild(input);
      input.select();
      document.execCommand("Copy");
      document.body.removeChild(input);
      this.msgSuccess("复制二维码链接成功");
    },
    getCommercial(businessCode) {
      getCommercialData(businessCode).then((response) => {
        this.CommercialData = response.data;
        this.auditState = response.data.auditState;
        // debugger
        console.log("支付授权状态："+this.auditState)
        this.applet = response.data.applet;
        this.mpInfo = response.data.mpInfo;
        if (response.data.auditResult){
          console.log("支付授权状态："+this.auditState)
          this.sign_url = response.data.auditResult.sign_url;
          this.applyment_state_msg = response.data.auditResult.applyment_state_msg;
          this.audit_detail = response.data.auditResult.audit_detail;
        }

        this.$refs.mychild.getCommercial(this.CommercialData);
      });
    },
    registerPlay() {
      var authorizerAppid = this.authorizerAppid
      var businessCode = this.businessCode
      this.$router.push("/payAudit/data?authorizer="+authorizerAppid+"&businessCode="+businessCode);
    },
    newRegisterPlay(){
      var authorizerAppid = this.authorizerAppid
      var businessCode = null
      this.$router.push("/payAudit/data?authorizer="+authorizerAppid+"&businessCode="+businessCode);
    },
    getisBindThirdParty() {
      isBindThirdParty(this.authorizationType).then((response) => {
        this.MerchantID = response.merchantId;
        this.MerchantIDType = response.merchantId;
        this.authorizationStatus = response.authorizationStatus;
        this.authorizerAppid = response.authorizerAppid
        this.businessCode = response.businessCode
        // if(this.authorizationStatus==0){
        //   this.getCommercial(response.businessCode);
        // }
        if (response.authorizerType == "allwork") {
          if (response.authorizationStatus == 0) {
            this.nextStep = false;
          }
        }
      });
    },
    release() {
      releaseRequest(this.authorizationType).then((response) => {});
    },
    SelectTemplate() {
      this.$router.push("/platform/template");
    },
    complete() {
      this.$router.go(0);
    },
    Next() {
      this.active = 2;
      this.getAuthorizer();
    },
    Next1() {
      this.active = 2;
      this.getAuthorizer();
    },
    Next3() {
      this.active = 1;
    },
    Next4() {
      this.active = 3;
    },
    qrcode() {
      let qrcode = new QRCode("qrcode", {
        width: 150, // 设置宽度，单位像素
        height: 150, // 设置高度，单位像素
        text: this.authorizationUrl, // 设置二维码内容或跳转地址
      });
      console.log(qrcode);
    },
    getAuthorizer() {
      getAuthorizerInfo(this.authorizationType).then((response) => {
        if(response) {
        this.loading = false;
       }
        this.auditstatus = response;
        this.authorizationUrl = response.authorizationUrl;
        this.qrcode()
      });
    },

    //点击授权
    authorization() {
      let indexUrl = process.env.VUE_APP_BASE+"/store/applet/appletViolations";
      let authorizationStatus = "0";
      appletGrant(indexUrl, this.authorizationType,authorizationStatus).then((response) => {
        let url = response.data.grantUrl;
        window.location.href = url;
      });
    },
    //注册小程序
    register() {
      window.open("https://mp.weixin.qq.com/", "_blank");
    },
    setPaymentTypeclick() {
      setPaymentTypeRequest(this.MerchantID, this.authorizationType).then(
        (response) => {
          if (response == 0) {
            this.msgSuccess("设置支付方式成功");
            this.MerchantID = "";
            this.nextStep1 = false;
          } else {
            this.msgError("设置支付方式失败");
            this.MerchantID = "";
            this.nextStep1 = true;
          }
          console.log("设置支付方式方式" + response);
        }
      );
    },

    //查询授权单列表
    getWechatPayAuditList() {
      wechatPayAuditList("SALES_SCENES_MP").then((response) => {
        this.payData = response.data
        this.dialogVisible = true
      })
    },
    //切换授权单
    switchPay(row) {
      this.QuerySwitchPayAuditVo.authorizerAppid = this.authorizerAppid
      this.QuerySwitchPayAuditVo.businessCode = row.businessCode
      this.QuerySwitchPayAuditVo.authorizerType = "allwork"
      this.QuerySwitchPayAuditVo.subMchid = row.subMchid
      console.log("切换授权单请求参数")
      switchPayAudit(this.QuerySwitchPayAuditVo).then((response)=>{
        this.dialogVisible = false
      })
    }

  },
};
</script>

<style lang="scss" scoped>
.el-input__inner {
  text-align: center !important;
}
.el-button + .el-button {
  margin-left: 0;
}
el-input.text {
  text-align: center;
}
.steps {
  width: 1180px;
  height: auto;
  margin: 50px auto 0;
}
.bg {
  background-color: #f2f2f6;
  border-radius: 6px;
  width: 1200px;
  height: 550px;
  margin: 50px auto 0;
  padding: 10px;
  .AppletsBind {
    border-radius: 6px;
    width: 100%;
    height: 100%;
    background-color: #fff;
  }
  .AppletsBindP {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    font-weight: bold;
    color: #595961;
    position: relative;
    top: 13px;
    // left: 10px;
  }
  .AppletsBindDiv {
    position: relative;
    width: 500px;
    height: 300px;
    border: 1px solid #e3e2e5;
    display: inline-block;
    margin: 30px 0 0 60px;
    border-radius: 6px;
    .AppletsBindDivLeft {
      width: 60px;
      height: 73px;
      position: absolute;
      left: 50%;
      top: 20%;
      margin-left: -30px;
      .AppletsBindDivLeftImg {
        width: 60px;
        height: 73px;
        background-image: url("../../../assets/images/bindApplet.png");
        background-size: 100% 100%;
      }
      .AppletsBindDivtopImg {
        width: 150px;
        height: 150px;
        position: relative;
        top: -40px;
        left: -40px;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .AppletsBindButton {
        position: relative;
        top: 40px;
        right: 60px;
        width: 186px;
        height: 40px;
      }
      .AppletsBindTitle {
        position: relative;
        top: 60px;
        right: 68px;
      }
      .AppletsBindDivtop {
        width: 60px;
        height: 73px;
        position: absolute;
        left: 50%;
        top: 10%;
        margin-left: -30px;
        .AppletsBindDivtopImg {
          width: 60px;
          height: 73px;
          background-image: url("../../../assets/images/payment.png");
          background-size: 100% 100%;
        }
        .AppletsBindBox {
          position: absolute;
          top: 90px;
          left: -55px;
        }
        .AppletsBindButton2 {
          width: 186px;
          height: 40px;
        }
      }
    }
    .AppletsBindDivRight {
      width: 60px;
      height: 73px;
      position: absolute;
      left: 50%;
      top: 20%;
      margin-left: -30px;
      .AppletsBindDivRightImg {
        width: 60px;
        height: 73px;
        background-image: url("../../../assets/images/appleyForApplet.png");
        background-size: 100% 100%;
      }
      .GainCommercial {
        width: 60px;
        height: 73px;
        background-image: url("../../../assets/images/gainCommercial.png");
        background-size: 100% 100%;
      }
      .AppletsBindButton {
        position: relative;
        top: 40px;
        right: 60px;
        width: 195px;
        height: 40px;
      }
      .AppletsBindTitle {
        position: relative;
        top: 60px;
        right: 68px;
      }
    }
  }
  .AppletsBindbtn {
    display: inline-block;
    margin: 35px 0 0 60px;
    width: 1060px;
    height: 80px;
    border-radius: 6px;
    border: 1px solid #e3e2e5;
    text-align: center;
    line-height: 60px;
    .AppletsBindbtnIcon {
      width: 22px;
      height: 26px;
      background-image: url("../../../assets/images/AppletsBindBottom.png");
      background-size: 100% 100%;
      display: inline-block;
      position: relative;
      top: 7px;
      right: 7px;
    }
  }
  .AppletsBindbtn1 {
    display: inline-block;
    margin: 35px 0 0 60px;
    width: 520px;
    height: 80px;
    border-radius: 6px;
    border: 1px solid #e3e2e5;
    text-align: center;
    line-height: 60px;
    .AppletsBindbtnIcon {
      width: 22px;
      height: 26px;
      background-image: url("../../../assets/images/AppletsBindBottom.png");
      background-size: 100% 100%;
      display: inline-block;
      position: relative;
      top: 7px;
      right: 7px;
    }
  }
  .AppletsBindbtn2 {
    display: inline-block;
    margin: 35px 0 0 20px;
    width: 520px;
    height: 80px;
    border-radius: 6px;
    border: 1px solid #e3e2e5;
    text-align: center;
    line-height: 60px;
    .AppletsBindbtnIcon {
      width: 22px;
      height: 26px;
      background-image: url("../../../assets/images/AppletsBindBottom.png");
      background-size: 100% 100%;
      display: inline-block;
      position: relative;
      top: 7px;
      right: 7px;
    }
  }
  .AppletsBindDiv2 {
    position: relative;
    width: 500px;
    height: 300px;
    border: 1px solid #e3e2e5;
    left: 50%;
    top: 30px;
    margin-left: -250px;
    border-radius: 6px;
    .AppletsBindDivtop {
      width: 60px;
      height: 73px;
      position: absolute;
      left: 50%;
      top: 20%;
      margin-left: -30px;
      .AppletsBindDivtopImgtow {
        width: 100%;
        height: 100%;
        background-image: url("../../../assets/images/payment.png");
        background-size: 100% 100%;
      }
      .AppletsBindDivtopImg {
        width: 150px;
        height: 150px;
        position: relative;
        top: -40px;
        left: -40px;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .AppletsBindBox {
        position: absolute;
        top: 90px;
        left: -55px;
      }
      .AppletsBindButton2 {
        // position: absolute;
        //   bottom:20px;
        //   left: 150px;
        width: 186px;
        height: 40px;
      }
    }
  }
  .AppletsBindDiv3 {
    position: relative;
    width: 500px;
    height: 300px;
    border: 1px solid #e3e2e5;
    left: 50%;
    top: 30px;
    margin-left: -250px;
    border-radius: 6px;
    img {
      width: 240px;
      height: 240px;
      position: absolute;
      top: 50%;
      left: 50%;
      margin: -130px 0 0 -120px;
    }
  }
}
</style>
